package yunquan.wang.modules.base.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

import yunquan.wang.base.domain.IdEntity;

@Entity
@Table(name = "base_rulesinfo")
public class RulesInfo extends IdEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 6334650383513794822L;
 
	public static final String RULE_TYPE_USER="user_id";//用户
	public static final String RULE_TYPE_GROUP="group_id";//组织机构
	public static final String RULE_TYPE_GOUP_TYPE="group_type_id";//机构类型
	public static final String RULE_TYPE_PROERTY="property";//属性
	public static final String RULE_TYPE_SQL="sql";//sql限制 TODO
 @Column(name="info",length=20)
	private String info;//说明
 @Column(name="type",length=10)
   private String type;//
 @Column(name="name",length=20)
   private  String name;//EQS_USER_ID
 @Column(name="value",length=30)
   private String value;//
   
	public String getValue() {
	return value;
}
public void setValue(String value) {
	this.value = value;
}
	@ManyToMany(cascade = CascadeType.REFRESH, mappedBy = "rulesInfos", fetch = FetchType.LAZY)
	private Set<RolesAuthority> rolesAuthority=new HashSet<RolesAuthority>(0);
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	
	public String getInfo() {
		return info;
	}
	public void setInfo(String info) {
		this.info = info;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public Set<RolesAuthority> getRolesAuthority() {
		return rolesAuthority;
	}
	public void setRolesAuthority(Set<RolesAuthority> rolesAuthority) {
		this.rolesAuthority = rolesAuthority;
	}
	

}
